import 'package:baselib/utils/image_util.dart';
import 'package:baselib/widgets/nosize_app_bar.dart';
import 'package:flutter/material.dart';
import 'package:framelib/utils/color_util.dart';
import 'package:framelib/utils/drawable_util.dart';
import 'package:framelib/utils/px_util.dart';
import 'package:framelib/widgets/comm_widget_manager.dart';
import 'package:framelib/widgets/page_widget.dart';
import 'package:get/get.dart';
import 'package:module_business/module_comm/viewmodel/splash_view_model.dart';
import 'package:flustars_flutter3/flustars_flutter3.dart';
class SplashPage extends GetWidget<SplashViewModel> {
  @override
  Widget build(BuildContext context) {
    var size2 = MediaQuery.of(context).size;
    //设置字体大小根据系统的“字体大小”辅助选项来进行缩放,默认为false
    setDesignWHD(size2.width,size2.height, density: 3);
    // setDesignWHD(375,812, density: 0);
    return PageWidget.build(
      builder: (SplashViewModel model){
        return PageWidget.PageScaffoldWidget(
          appBar: NoSizeAppBar(
            backgroundColor: ColorUtil.instance.color_white,
          ),
          body: FadeTransition(//透明度动画组件
            opacity: model.animation, //动画
            child: Container(
                color: ColorUtil.instance.color_white,
                width: PxUtil.instance.screenWidth,
                height: PxUtil.instance.screenHeight,
                alignment: Alignment.center,
                child: Column(
                  mainAxisSize: MainAxisSize.max,
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    CommWidgetManager.buildCicleImagWidget(
                      null,
                      placeholder: DrawableUtil.instance.icon_default_head,
                      width: PxUtil.instance.px_100,
                      height: PxUtil.instance.px_100,
                      backgroundColor: ColorUtil.instance.color_f2f2f2,
                      padding: EdgeInsets.only(),
                      margin: EdgeInsets.only(),
                    ),
                    Container(
                      margin: EdgeInsets.only(
                          top: PxUtil.instance.px_38,
                        bottom: PxUtil.instance.screenHeight/4
                      ),
                      child: Text(
                        'Interest Voice -  Group Voice Chat',
                        style: TextStyle(
                            fontSize: PxUtil.instance.px_14,
                            color: ColorUtil.instance.color_101010
                        ),
                      ),
                    )
                  ],
                )
            ),
          ),
        );
      }
    );
  }
}
